using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using  Domain.Entidades;
namespace Data.Models.Mapping
 
{
    public class VW_setorMap : EntityTypeConfiguration<VW_setor>
    {
        public VW_setorMap()
        {
            // Primary Key
            this.HasKey(t => new { t.set_codigo, t.set_descricao });

            // Properties
            this.Property(t => t.set_codigo)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.set_descricao)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("VW_setor");
            this.Property(t => t.set_codigo).HasColumnName("set_codigo");
            this.Property(t => t.set_descricao).HasColumnName("set_descricao");
        }
    }
}
